feat: Add dbtool command to restore recovered data#3451
Open
sadhansood wants to merge 1 commit into
Open
Conversation
9476323 to
5d9f798
Compare
5d9f798 to
d81d928
Compare
halfprice
approved these changes
Jun 8, 2026
halfprice
left a comment
Collaborator
There was a problem hiding this comment.
Thank you @sadhansood! The tool LGTM (and assume you have tried to use it successfully). Have a few comments for you to consider.
|
|
||
| const RESTORE_CF_WRITE_BATCH_SIZE: usize = 10_000; | ||
|
|
||
| fn restore_column_families( |
Collaborator
There was a problem hiding this comment.
Remark: should we consider take stoarge node config as input so that users' local DB config is applied in the restored CF?
| "crates/walrus-upload-relay", | ||
| "crates/walrus-utils", | ||
| ] | ||
| exclude = ["crates/rocksdb"] |
Collaborator
There was a problem hiding this comment.
Question: what is this for?
|
|
||
| /// A mapping from an input RocksDB column family to an output Walrus DB column family. | ||
| #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
| pub struct ColumnFamilyMapping { |
Collaborator
There was a problem hiding this comment.
Nit: can you add examples to show how to use this command in the PR description and the commandline helper string? The input and output are just string makes it too free to set.
| output: String, | ||
| } | ||
|
|
||
| fn parse_column_family_mapping(value: &str) -> std::result::Result<ColumnFamilyMapping, String> { |
Collaborator
There was a problem hiding this comment.
Nit: use anyhow::result ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a dbtool command to replace corrupted CF with data from a restored one. User passes in CF mappings b/w two databases and it copies data over one at a time.
Test plan
Unit tests.